<?php

class KnowledgeModel extends Model 
{

	protected $_validate=array(
		array('title','require','文章标题不能为空',0,'','all'),
		array('intro','require','文章简介不能为空',0,'','all'),
		array('htmlbody','require','文章内容不能为空',0,'','all'),		
	);	
	protected $_auto  =  array(  	
        array('addtime','time','ADD','function'),
	);
	protected function _after_create(&$data)
	{
		$id=$data['id'];
		$url="$id-knowledge.html";
		$query="UPDATE __TABLE__ SET url='$url' WHERE id='$id'";
		$this->execute($query);
	}	
}
?>